feat: add fft/base/fftpack/rfftf#12002
Conversation
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
|
Opened this draft PR to discuss the implementation or ask questions, if any, and to track progress. |
| var TAUR = -0.5; // cos( 2π/3 ) | ||
| var TAUI = 0.866025403784439; // sin( 2π/3 ) |
There was a problem hiding this comment.
I could have used math/base/special/sin and math/base/special/cos here, but instead I have hardcoded the exact constants used in pffft (Ref: https://github.com/marton78/pffft/blob/master/src/fftpack.c#L1308), to be as close as possible, to the actual results. Using math/base/special/sin and math/base/special/cos leads to slightly off results. If we are fine with that, I'll replace these hardcoded constants with stdlib functions.
There was a problem hiding this comment.
Not must difference for sin, but there is some difference for cos:
In [5]: var cos = require('@stdlib/math/base/special/cos')
Out[5]: [Function: cos]
In [6]: cos((2*pi)/3)
Out[6]: -0.4999999999999998
In [7]: var cos = require('@stdlib/math/base/special/cosf')
Out[7]: [Function: cosf]
In [8]: var pi = require('@stdlib/constants/float32/pi')
Out[8]: 3.1415927410125732
In [9]: cos((2*pi)/3)
Out[9]: -0.5000000596046448
In [10]:
There was a problem hiding this comment.
Yes, that seems reasonable to me. Better to use exact values. However, instead of cos and sin, for multiple of pi, one should use sinpi and cospi which will give you more accurate results.
There was a problem hiding this comment.
Thanks, I've now replaced the use of hardcoded constants by sinpi and cospi in 5f3fc63.
There was a problem hiding this comment.
Given that these are one time computations, it is probably preferable to just hard code the constants. My point about using sinpi and cospi is, if one were to perform computation, those should be used when what you are wanting to evaluate is a multiple of pi.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves None.
Description
This pull request:
fft/base/fftpack/rfftf, which is a part of fftpack.fft/base/fftpack#4121.Related Issues
This pull request has the following related issues:
None.
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Used AI to understand the implementation, reason about specific choices and to help write equations and explanations in implementation comments. Also referred it to understand the working of FFTs.
@stdlib-js/reviewers